package com.cbgolf.oa.event;

import com.cbgolf.oa.entity.MessageBean;
import java.util.List;

/**
 * @author lq
 */
public class EventMsg {


  /**
   * 消息目的地
   */
  public int target;
  /**
   * 请求操作 refresh loadmore initdata
   */
  public int requestType;

  /**
   * error msg code
   */
  public String errorMsg;
  public int errorCode;

  public List<MessageBean> listMsg;
  public boolean haveNotRead;

  public static class Builder {

    EventMsg bean;

    public Builder() {
      bean = new EventMsg();
    }

    public Builder setListMsg(List<MessageBean> list) {
      bean.listMsg = list;
      return this;
    }

    public Builder setRequestType(int type) {
      bean.requestType = type;
      return this;
    }

    public Builder setError(String error, int code) {
      bean.errorMsg = error;
      bean.errorCode = code;
      return this;
    }

    public Builder setTarget(int target) {
      bean.target = target;
      return this;
    }

    public Builder setHaveNotRead(boolean has) {
      bean.haveNotRead = has;
      return this;
    }

    public EventMsg build() {
      return bean;
    }
  }
}
